<script type="text/javascript">
  var config = {
    "sonar_url":baseUrl,
    "version":"<%= sonar_version -%>",
    "popup":"<%= popup -%>"
    <% if metric %>, "metric":"<%= metric -%>"
    <% end %>

    <%
      if resource
    %>, "resource_key":"<%= resource.id -%>",
    "resource":[
      {"id": <%= resource.id -%>, "key":"<%= resource.key -%>", "scope":"<%= resource.scope -%>", "qualifier":"<%= resource.qualifier -%>", "name":"<%= resource.name -%>", "lang":"<%= resource.language -%>"}
    ]
    <% end %>
  };

  var rp = {
    <%
      index=0
      params.each do |key,value|
    %>
    <%= ',' if index>0 -%>"<%= h(key) -%>":"<%= h(value) -%>"
    <%
        index+=1
      end
    %>
  };

  var modules = new Object();
  <%= Java::OrgSonarServerUi::JRubyFacade.getInstance().getJsL10nDictionnary(I18n.locale) -%>
</script>